<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="div"></div>

    <script>
        const div = document.getElementById('div')

        // document.createTextNode(text), 这个方法也可以解析HTML标签
        const textNode = document.createTextNode('textNode')
        const textNode1 = document.createTextNode('textNode1')
        div.appendChild(textNode)
        div.appendChild(textNode1) // 也可以给div创建多个文本节点
    </script>
</body>
</html>